﻿<%@ Page Title="Sistema Acadêmico - Turmas" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Turma.aspx.cs" Inherits="ManterTurma" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style1
        {
            font-size: medium;
            font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <h2 class="style1">
        Turmas</h2>
    <p>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
            Text="Inserir Nova Turma" />
    </p>
<p>
        Busca:</p>
    <p>
        Série:
        <asp:TextBox ID="txtSerie" runat="server"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ano:<asp:TextBox ID="txtAno" 
            runat="server">2011</asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Turno:<asp:DropDownList 
            ID="ddlTurno" runat="server">
            <asp:ListItem></asp:ListItem>
            <asp:ListItem>Matutino</asp:ListItem>
            <asp:ListItem>Vespertino</asp:ListItem>
        </asp:DropDownList>
    </p>
    <p>
        <asp:Button ID="btnBuscar" runat="server" Text="Buscar" 
            onclick="btnBuscar_Click" />
    </p>
<p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="ObjectDataSource1">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" SortExpression="id" />
                <asp:BoundField DataField="Serie" HeaderText="Serie" SortExpression="Serie" />
                <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                <asp:BoundField DataField="Ano" HeaderText="Ano" SortExpression="Ano" />
                <asp:BoundField DataField="Turno" HeaderText="Turno" SortExpression="Turno" />
                <asp:BoundField DataField="Qtdalunos" HeaderText="Quantidade de Alunos" 
                    SortExpression="Qtdalunos" />
                <asp:HyperLinkField DataNavigateUrlFields="id" 
                    DataNavigateUrlFormatString="TurmaInserir.aspx?id={0}" Text="Alterar" />
            </Columns>
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            DataObjectTypeName="Dominio.TurmaVO" DeleteMethod="excluir" 
            InsertMethod="salvar" SelectMethod="list" TypeName="Negocio.TurmaNegocio" 
            UpdateMethod="salvar">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtAno" Name="ano" PropertyName="Text" 
                    Type="String" />
                <asp:ControlParameter ControlID="txtSerie" Name="serie" PropertyName="Text" 
                    Type="String" />
                <asp:ControlParameter ControlID="ddlTurno" Name="turno" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </p>
    </asp:Content>

